/************************************************************************************
	
	Base64.h - Include file for Base64.dll.
	
************************************************************************************/

#ifndef _WINDOWS_

#error Windows.h must be included before Base64.h.

#else

#define BASE64API __stdcall
typedef const BYTE* LPCBYTE;
typedef void (BASE64API* BASE64CALLBACK)(HANDLE hThread, BOOL bSuccess, LPVOID lpvParam);

UINT	BASE64API CharsNeededToEncode(UINT cb);
UINT	BASE64API BytesNeededToDecode(UINT cb, UINT nEqualSigns);
UINT	BASE64API CountEqualSignsA(LPCSTR lpInput);
UINT	BASE64API CountEqualSignsW(LPCWSTR lpInput);
BOOL	BASE64API IsValidBase64StringA(LPCSTR lpString, LPUINT lpEqualSigns);
BOOL	BASE64API IsValidBase64StringW(LPCWSTR lpString, LPUINT lpEqualSigns);
BOOL	BASE64API Base64EncodeA(LPCBYTE lpInput, UINT cbInput, LPSTR lpOutput, UINT cbOutput);
BOOL	BASE64API Base64EncodeW(LPCBYTE lpInput, UINT cbInput, LPWSTR lpOutput, UINT cbOutput);
BOOL	BASE64API Base64DecodeA(LPCSTR lpInput, LPBYTE lpOutput, UINT cbOutput);
BOOL	BASE64API Base64DecodeW(LPCWSTR lpInput, LPBYTE lpOutput, UINT cbOutput);
HANDLE	BASE64API Base64EncodeAsyncA(LPCBYTE lpInput, UINT cbInput, LPSTR lpOutput, UINT cbOutput,
									 BASE64CALLBACK lpEndCallback, LPVOID lpvParam);
HANDLE	BASE64API Base64EncodeAsyncW(LPCBYTE lpInput, UINT cbInput, LPWSTR lpOutput, UINT cbOutput,
									 BASE64CALLBACK lpEndCallback, LPVOID lpvParam);
HANDLE	BASE64API Base64DecodeAsyncA(LPCSTR lpInput, LPBYTE lpOutput, UINT cbOutput,
									 BASE64CALLBACK lpEndCallback, LPVOID lpvParam);
HANDLE	BASE64API Base64DecodeAsyncW(LPCWSTR lpInput, LPBYTE lpOutput, UINT cbOutput,
									 BASE64CALLBACK lpEndCallback, LPVOID lpvParam);
BOOL	BASE64API GetEncodeAsyncState(HANDLE hThread, LPUINT uFinished, LPUINT uTotal);
BOOL	BASE64API GetDecodeAsyncState(HANDLE hThread, LPUINT uFinished, LPUINT uTotal);

#ifdef UNICODE

#define CountEqualSigns			CountEqualSignsW
#define IsValidBase64String		IsValidBase64StringW
#define Base64Encode			Base64EncodeW
#define Base64Decode			Base64DecodeW
#define Base64EncodeAsync		Base64EncodeAsyncW
#define Base64DecodeAsync		Base64DecodeAsyncW

#else

#define CountEqualSigns			CountEqualSignsA
#define IsValidBase64String		IsValidBase64StringA
#define Base64Encode			Base64EncodeA
#define Base64Decode			Base64DecodeA
#define Base64EncodeAsync		Base64EncodeAsyncA
#define Base64DecodeAsync		Base64DecodeAsyncA

#endif // !UNICODE

#endif // _WINDOWS_